Skip to content

feat: add normalize/paths/config CLI surface#33

Merged
StuBehan merged 1 commit into
mainfrom
feat/normalize-cli
Jul 9, 2026
Merged

feat: add normalize/paths/config CLI surface#33
StuBehan merged 1 commit into
mainfrom
feat/normalize-cli

Conversation

@StuBehan

@StuBehan StuBehan commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

The 0.6.0 speech-normalization feature shipped the stackvox.text library but not the CLI surface the design doc promised (docs/speech-normalization.md §4/§7), so normalize_for_speech was reachable only via a Python import. This exposes it — plus two other import-only surfaces (paths, config) — from the shell, so consumers like speaklast can normalize text without importing stackvox.

Changes

  • stackvox normalize — prints speech-normalized prose (Markdown → speakable text) to stdout; reads --file/positional/stdin. Model-free, so it stays shell-fast.
  • --normalize on speak/say (off by default → backward-compatible) normalizes before synth/daemon.
  • Full flag surface mapping 1:1 onto normalize_for_speech: --no-markdown, --no-expand-units, --no-expand-numbers, --no-pauses, --tables {drop,csv}, --strip-emoji, --no-terminal-stops, --locale, and --pronunciations FILE (a JSON {"written":"spoken"} map). A malformed pronunciations file fails with a clean [stackvox] … message, not a traceback.
  • stackvox paths (cache / socket / pid) and stackvox config (resolved voice/speed/lang + config path).
  • Bash completion extended (new subcommands, per-subcommand flags, --tables/--locale value completion, --pronunciations file completion).
  • README gains a "Speech normalization" section + paths/config in the CLI list; 12 new tests.

Testing

  • ruff check . and ruff format --check . clean; mypy clean (18 files); pytest177 passed.
  • Live smoke tests:
    • printf '**1,198.9** MPG at £1.63' | stackvox normalize1198 point 9 miles per gallon at 1 point 6 3 pounds.
    • --tables csv renders tables comma-separated; --pronunciations applies whole-word substitutions; bad JSON exits 1 with a clean message.
    • stackvox paths / stackvox config print resolved values; the emitted completion script passes bash -n.

Related issues

Refs the 0.6.0 speech-normalization design (docs/speech-normalization.md §4/§7 — the CLI half that wasn't built). CHANGELOG.md intentionally untouched (release-please owns it); lands in the next feat release (0.7.0).

@StuBehan StuBehan merged commit 448b17e into main Jul 9, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant